<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="../js/vue.min.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="app">
			<input type="button" id="" value="获取元素" @click="getElement"/>
			<h3 ref="myh3">H3的内容</h3>
			<login ref="mylogin"></login>
		</div>
		<script type="text/javascript">
			var login={
				template:'<h1>登录组件</h1>',
				data(){
					return{ msg:'组件的数据'}
				},
				methods:{
					show(){
						console.log('组件的方法')
					}
				}
			
			}
			var vm=new Vue({
				el:"#app",
				data:{},
				methods:{
					getElement(){
					console.log(this)
						console.log(this.$refs.myh3.innerText)
						console.log(this.$refs.mylogin.msg)
						this.$refs.mylogin.show()
					}
				},
				components:{
					login
				}
			});
		</script>
	</body>
</html>
